import socket
import struct
import binascii

if __name__ == '__main__':
    hexstr = 'ab 6d 78 00'
    print hexstr
    hexstr = hexstr.replace(' ', '')

    rs = int(hexstr, 16)
    print rs, socket.htonl(rs)